package com.kebaijia.ThreadPool;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * @desc:
 * @author: luoy
 * @date: 2020-11-18 17:18
 */
public class ThreanExpection {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService service = Executors.newSingleThreadExecutor();
        Runnable r = () -> System.out.println(10 / 0);
        Future<?> submit = service.submit(r);
        Object o = submit.get();
        service.shutdown();
    }
}
